import React from 'react';
import { inject, observer } from 'mobx-react';
import { WeaLocaleProvider,WeaNewScroll, WeaBrowser } from 'ecCom';
import { Button, Spin, Tooltip } from 'antd';
import RightTab from './RightTab';
import { observable, action, toJS } from 'mobx';
import * as myWorkPlanApi from '../../apis/myWorkPlan';
import moment from 'moment';
import { filterBR } from '../../util/util';
import '../../lib/wdCalendar_lang_wev8';

const i18n=window.workplanCalendarI18n;


const ButtonGroup = Button.Group;
const getLabel = WeaLocaleProvider.getLabel;
let LASTSTATUS = false;
@inject('createWorkPlanStore')
@inject('workPlanViewListStore')
@observer
class RightContainer extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      timeType: '',
      selected: '',
      selectedUser: '',
      date: new Date(),
      url:'',
      isIE: !!window.ActiveXObject || "ActiveXObject" in window || navigator.userAgent.indexOf('Firefox') >= 0,
      isFF: navigator.userAgent.indexOf('Firefox') >= 0,
    }
  }
  componentDidMount() {
     
  }
  shouldComponentUpdate(nextProps,nextState) {

  }
  componentWillReceiveProps(nextProps) {
   
    // 解决滚动条宽度占位问题 start
    // changetableScrollltop(false); 
    // end
  }
  componentDidUpdate() {
    const {status} = this.props.workPlanViewListStore;
    const {titleFold,timeType, isSpinning } = status
    titleFold === 1 && this.setLeftTrheight();
    (timeType == 'week' || timeType == 'month') && this.weeksScrollWidth();
    if ( LASTSTATUS != isSpinning ) {
      this.setScrollLeft();
    }
    LASTSTATUS = isSpinning;
    this.soveMonthScrollWidth();
  }

  componentWillUnmount() {
    // const {setParams} = this.props.workPlanViewListStore;
    // setParams({isWorkplanView: false}); // 标记日程一览表页面
  }

  soveMonthScrollWidth = () => { // 竖向滚动条宽度
    const { setParams } = this.props.workPlanViewListStore;
    if (this.refs.rightTop && this.refs.rightTable) {
      this.refs.rightTable.offsetHeight > this.refs.rightTop.offsetHeight ? 
        setParams({monthYScrollVisible: true}) : setParams({monthYScrollVisible: false});
    }
  }

  setScrollLeft = () => {
    const {status} = this.props.workPlanViewListStore;
    if (status.timeType === 'month' && this.refs.hearderTimeItem && this.refs.rightTable) { // 解决上次滚到中部后切换数据显示样式问题
      this.refs.hearderTimeItem.scrollLeft = 0;
      this.refs.rightTable.scrollLeft = 0;
    }
  }

  setLeftTrheight = () => {
    const {amAndPm,} = this.props.workPlanViewListStore.status;
    let trHeight = [];
    let trArr = jQuery("#display-workplanItem-container tbody tr");
    let leftTrHeight = jQuery('#left-content-tr tr');
    if(trArr.length > 0) {
      for(let item in trArr) {
        if(item === 'length'){
          break;
        }
        let h = trArr[item].getBoundingClientRect().height;
        let height = (item == '0'&&!this.state.isIE&&!this.state.isFF) ? h+1 : h;
        trHeight.push(height+'px');
      }
    }
    if(leftTrHeight.length > 0) {
      let loc = 0;
      for(let item in leftTrHeight) {
        if(item === 'length'){
          break;
        }
        !amAndPm ? jQuery('#left-content-tr tr').find('td').eq(loc).css({'height':trHeight[loc],})
          : jQuery('#left-content-tr').find('tr').eq(loc).css({'height':trHeight[loc],});
        loc++;
      }
    }
  }

  weeksScrollWidth = () => {
    const {setParams} = this.props.workPlanViewListStore;
    if(this.refs.rightTable && this.refs.rightTop && ( this.refs.rightTable.offsetHeight>this.refs.rightTop.offsetHeight)) {
      setParams({weekScrolllwidth: true});
    }else{
      setParams({weekScrolllwidth: false});
    }
  }

  render() {
    let amMax = [];
    let pmMax = [];
    let { status,listDate, weekScrolllwidth,monthYScrollVisible } = this.props.workPlanViewListStore;
    let { timeType, dateMoment, dayOfWeek, isSpinning, amAndPm,dataRule } = status;
    listDate = toJS(listDate);
    let {memberids,useMap,useMap_pm}=listDate;

    let HH = 25;
    let browserParam = {
      hasAddBtn: false,
      hasAdvanceSerach: true,
      idSeparator: ",",
      isAutoComplete: 1,
      isDetail: 0,
      isMultCheckbox: false,
      isSingle: true,
      linkUrl: "/hrm/resource/HrmResource.jsp?id=",
      pageSize: 10,
      quickSearchName: "",
      title: `${getLabel(179,'人力资源')}`,
      type: "1",
      viewAttr: 2,
    }
    let { blockNum, tableHeaders } = this.getTableHeaderInfo(timeType, dateMoment);
    let tableWidth = jQuery(".table-right").width();
    let one_width=amAndPm?130:107;
    let seven_width=this.state.isIE ? 35 : (amAndPm?10:8);
    let thStyle = blockNum == 1 ? { width: (tableWidth - one_width), textAlign: 'center' } : blockNum == 7 ? { width: (tableWidth-seven_width ) / 7 - 2, textAlign: 'center' } : { width: '130px', textAlign: 'center' };
    let tableContent = (
      (memberids && memberids.length > 0) &&
      memberids.map((room, index) => {
        let replaceDatas = [];
        let amp=['am','pm'];

        replaceDatas.push(room);
        let tdList = this.createTdList(room, blockNum, useMap, dayOfWeek, thStyle);
        let tdList_pm =[];
        if(amAndPm){
          tdList_pm=this.createTdList(room, blockNum, useMap_pm, dayOfWeek, thStyle);
        }
        const getMax = (tdList,tdList_pm) => {
          let ammax = 0; 
          let pmmax = 0; 
          if(tdList) {
            if(!(tdList instanceof Array)) { // 日模式下tdList不是数组，转化成数组
              let arr = [];
              arr.push(tdList);
              tdList = arr;
            }
            tdList instanceof Array && tdList.map(res => {
              ammax = res.props.children.length>ammax ? res.props.children.length : ammax;
            })
            amMax.push(ammax);
          }
          if(tdList_pm) {
            if(!(tdList_pm instanceof Array)) {
              let arr = [];
              arr.push(tdList_pm);
              tdList_pm = arr;
            }
            tdList_pm instanceof Array && tdList_pm.map(res => {
              pmmax = res.props.children.length>pmmax ? res.props.children.length : pmmax;
            })
            pmMax.push(pmmax);
          }
        }
        getMax(tdList,tdList_pm);

        return (
          amAndPm ? 
          (amp.map((key, index)=>{
              return (
                  key==='am' ?
                  <tr className={index == 0 ? "no-border-top" : ""} >
                      {tdList}
                  </tr>
                  :
                  <tr className={index == 0 ? "no-border-top" : ""}>
                      {tdList_pm}
                  </tr>
              );
          }))
          :
          <tr className={index == 0 ? "no-border-top" : ""}>
            {tdList}
          </tr>
        );
      })
    );
    
    let leftContent = (
      (memberids && memberids.length > 0) &&
      memberids.map((room, index) => {
        let replaceDatas = [];
        let amp=['am','pm'];
        
          replaceDatas.push(room);
          let hasEllipsis = false;
          if(replaceDatas&&replaceDatas[0]&&typeof replaceDatas[0].name=='string') {
            if(amAndPm) {
              hasEllipsis = (replaceDatas[0].name.split('').length)/9 - amMax[index] - pmMax[index] > 0;
            } else {
              hasEllipsis = (replaceDatas[0].name.split('').length)/9 - amMax[index] > 0;
            }
          }
          return (
            amAndPm ? 
            (amp.map((key, i)=>{
                return (
                    key==='am' ?
                    <tr className={i == 0 ? "no-border-top" : ""} style={{height: amMax[index]*HH+1}}>
                        <td style={{ backgroundColor: '#f5f7fa', borderLeft: 'none',verticalAlign:"middle",textAlign: "center" }} rowSpan={2}>
                          <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@exf49i@${room.id}`} className={hasEllipsis?"workplan-left-name":''} {...browserParam} viewAttr={1} replaceDatas={replaceDatas} inputStyle={{ width: '100px' }} />
                        </td>
                        <td style={{verticalAlign:"middle",textAlign: "center",width: 45,borderRight:'1px solid #E2E2E2'}}>{i18n.langId==='8'?'AM':getLabel(16689,'上午')}</td>
                    </tr>
                    :
                    <tr className={i == 0 ? "no-border-top" : ""} style={{height: pmMax[index]*HH+1}}>
                        <td style={{verticalAlign:"middle",textAlign: "center",width: 45,borderRight:'1px solid #E2E2E2'}}>{i18n.langId==='8'?'PM':getLabel(16690,'下午')}</td>
                    </tr>
                );
            }))
            :
            <tr className={index == 0 ? "no-border-top" : ""}>
              <td style={{ backgroundColor: '#f5f7fa', borderLeft: 'none',verticalAlign:"middle",textAlign: "center", 
                  height: amMax[index]*HH+1}}>
                <WeaBrowser ecId={`${this && this.props && this.props.ecId || ''}_WeaBrowser@8oyl4z@${room.id}`} className={hasEllipsis?"workplan-left-name":''} {...browserParam} viewAttr={1} replaceDatas={replaceDatas} inputStyle={{ width: '145px' }} />
              </td>
            </tr>
          );
        })
      );
    let thHeaderStyle = timeType==='week'&&weekScrolllwidth ? { width: (tableWidth-seven_width ) / 7 - 3,textAlign: 'center', height: '44px', lineHeight: '44px',} : { ...thStyle, height: '44px', lineHeight: '44px',}
    let {style=false} = this.props;
    let normalStyle = { paddingLeft: '221px', width: '100%', height: '100%' };
    
    normalStyle = {width: '100%', height: '100%' }
    
    let hrmStyle = {}
    if(style){
      hrmStyle = {...normalStyle, ...style}
    }else{
      hrmStyle = normalStyle
    }
    let dataRuleStr=dataRule==1?getLabel(882,'创建人'):getLabel(15525,'接收人');
    return (
      <div className="myWorkplan-right" id='myWorkplanright2' style={hrmStyle}>
        {/* <RightTab isAllWorkPlan={this.props.isAllWorkPlan} /> */}
        <RightTab ecId={`${this && this.props && this.props.ecId || ''}_RightTab@5dh3p3`} />
        <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@dqbxh1`} spinning={isSpinning}>
          <div style={{ display: 'block', overflowY: 'auto', height: '100%', width: '100%', paddingTop: '45px' }}>
            {/*  表单左侧 */}
            <div className='table-left ' ref='tableLeft' style={{border: '0px solid red',height: this.state.isIE&&timeType==='month' ? "100%" :(timeType==='month' ? "calc(100% - 7px)" : '100%')}}>
                <table className="room-plan-tab-header" style={{width: '100%',height: '45px',lineHeight: '45px',borderSpacing: '0px',borderBottom: '1px solid #E2E2E2',borderRight:'1px solid #E2E2E2'}} >
                  <tbody>
                    {tableHeaders && tableHeaders.length > 0 && (
                      <tr style={{height: '45px'}}>
                        {amAndPm &&<td className="onlyShow" style={{borderRight:'0px'}}><div style={{ width: '104px' }} >{dataRuleStr}</div></td>}
                        {amAndPm &&<td className="onlyShow" ><div style={{ width: '34px' }} ></div></td>}
                        {!amAndPm && <td className="onlyShow" ><div style={{ width: '140px' }} >{dataRuleStr}</div></td>}
                        {/* {!amAndPm &&<td className="onlyShow" ><div style={{ width: '34px' }} ></div></td>} */}
                      </tr>
                    )}
                  </tbody>
                </table>
                {(memberids && memberids.length > 0) && 
                    <div className='left-content' id='left-content-tr' ref='leftContent' style={{ overflow: 'hidden',background: this.state.color, height: this.state.isIE&&timeType==='month' ? 'calc(100% - 64px)':(timeType==='week'||timeType==='day' ? 'calc(100% - 47px)': 'calc(100% - 50px)')}}>
                      {leftContent}
                    </div>
                }
            </div>
            {/* 表单右侧 */}
            <div className='table-right' style={{width: timeType==='week' ? (amAndPm? 'calc(100% - 146px)':'calc(100% - 146px)') 
              : tableContent&&tableContent.length>0 ? (amAndPm?'calc(100% - 146px)' :'calc(100% - 150px)') :'calc(100% - 150px)', 
                    height: this.state.isIE&& timeType==='month' ? '100%' : '100%'}}>
              <div className='right-header right-top' ref='hearderTimeItem' style={{ width: this.state.isFF ? 
                ( timeType==='week'&&weekScrolllwidth ? `calc(100% - 17px)` : (timeType==='month'&&weekScrolllwidth ?'calc(100% - 17px)':'100%'))
                :
                this.state.isIE ? 
                  (timeType==='week'&&weekScrolllwidth  ? `calc(100% - 17px)` : (timeType==='month'&&!weekScrolllwidth||timeType==='week'&&!weekScrolllwidth||timeType==='day'?'100%':'calc(100% - 17px)') )
                  :
                  (timeType==='week'&&weekScrolllwidth  ? `calc(100% - 10px)` : (timeType==='month'&&monthYScrollVisible ? 'calc(100% - 10px)' : 'calc(100% - 0px)')),
              overflow: timeType==='month' && tableContent ? 'hidden' : 'auto',border: '0px solid red' }}>
                <table className="room-plan-tab-header" style={{}}>
                  <tbody>
                    {tableHeaders && tableHeaders.length > 0 && (
                      <tr className='hearderTimeItem' style={{whiteSpace: 'nowrap',height: this.state.isFF ? '46px':'45px'}}>
                        {tableHeaders.map((header) => {
                          return (<td style={{border: 0,borderRight: '1px solid #e2e2e2',borderBottom: '1px solid #e2e2e2'}}><div style={thHeaderStyle} ><span>{header}</span></div></td>);
                        })}
                      </tr>
                    )}
                  </tbody>
                </table>
               
              </div>
              {(memberids && memberids.length > 0) && 
                <div className="right-top" id='display-workplanItem-container'
                  ref='rightTop'
                  style={{ overflow: 'auto', 
                  height: this.state.isIE && timeType==='month' ? (tableContent&&tableContent.length>0 ? 'calc(100% - 46px)' : 'calc(100% - 62px)')
                    : (timeType==='month' && tableContent===false ? 'calc(100% - 53px)' : 'calc(100% - 46px)')}}
                  onScroll={this.onscroll}
                >
                <table className="room-plan-tab-header" ref='rightTable'  >
                  <tbody >
                    {tableContent}
                  </tbody>
                </table>
              </div>}
            </div>
          </div>
        </Spin>
      </div>
    )
  }

  onscroll = (e) => {
    const { status } = this.props.workPlanViewListStore
    let { timeType} = status
    if(timeType == 'month') {
      this.refs.leftContent.scrollTop = e.target.scrollTop;
      if(e.target.scrollLeft + this.refs.rightTop.clientWidth >= this.refs.rightTable.scrollWidth) {
        this.refs.hearderTimeItem.scrollLeft = e.target.scrollLeft+8;
      }else{
        this.refs.hearderTimeItem.scrollLeft = e.target.scrollLeft;
      }
    }else{
      this.refs.hearderTimeItem.scrollLeft = e.target.scrollLeft;
      this.refs.leftContent.scrollTop = e.target.scrollTop;
    }
  }

  createTdList = (room, blockNum, useMap, dayOfWeek, thStyle) => {
    let HH = '25px';
    const { status } = this.props.workPlanViewListStore
    let { timeType, date, dateMoment, titleFold } = status
    let titleFoldStyle = titleFold === 1 ? {} : {whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',} ;
    let isHeight = titleFold === 1 ? {} : {height: HH};
    useMap = toJS(useMap);
    let tdList = [];
    let useArray = useMap[room.id];
    dayOfWeek = toJS(dayOfWeek);
    if (timeType == 'week' || timeType == 'month') {
      for (let i = 0; i < blockNum; i++) {
        tdList.push([]);
      }
      useArray && useArray.forEach((obj, index) => {
        const fontColor = this.Fontcolor(obj.color)
        let thStyleCopy = { ...thStyle,...isHeight, backgroundColor: obj.color,color:fontColor, textAlign: 'left', borderBottom: '1px solid #fff', /*whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',color: '#fff' ,*/cursor: 'pointer'}
        let tdIdx = '';
        obj.showname = filterBR(obj.showname);
        if (timeType == 'month') {
          tdIdx = Number(obj.begindate.split('-')[2] - 1)
        }
        if (timeType == 'week') {
          tdIdx = dayOfWeek.indexOf(`${obj.begindate}`)
        }
        if (tdIdx < 0 || tdIdx >= blockNum) return;
        let workid = []
        workid.push(obj.id);
        let tipTitle = Array.isArray(obj.title) && obj.title.filter(v => v !== '').length > 0;
        tdList[tdIdx].push(<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@bwct5k@${obj.id}`} overlayStyle={{ wordBreak: 'break-all' }} title={tipTitle ? obj.title.map((tip) => <div>{tip}</div>) : ''} placement="bottomRight" >
          <div onClick={() => { this.view(workid) }} style={thStyleCopy}>
            <div style={{...titleFoldStyle,paddingLeft: '4px',paddingTop: '5px',paddingBottom: '5px',minHeight:HH,wordBreak: 'break-all',}}>
             {`${obj.showname}`}
            </div>
          </div>
        </Tooltip>)
      });
      for (let i = 0; i < blockNum; i++) {
        thStyle = { ...thStyle, minHeight: HH }
        tdList[i].push(<div className="roomplan-td-modal" style={thStyle}></div>);
      }
      dayOfWeek = toJS(dayOfWeek);
      return (tdList.map((e,index) => {
        if(timeType === 'week' && dayOfWeek[index] === moment().format('YYYY-MM-DD')){ // 当天做颜色处理
          return <td style={{backgroundColor: '#ffc'}}>{e}</td>
        }else if(timeType === 'month' && dayOfWeek[index] === moment().format('YYYY-MM-DD')) {
          return <td style={{backgroundColor: '#ffc'}}>{e}</td>
        }else{
          return <td>{e}</td>
        }
      }));
    } else {
      tdList.push([]);
      useArray && useArray.forEach((obj) => {
        const fontColor = this.Fontcolor(obj.color)
        let thStyleCopy = { ...thStyle,width:'100%',paddingLeft: '4px', lineHeight: HH,height: HH, backgroundColor: obj.color,color:fontColor, textAlign: 'left', borderBottom: '1px solid #fff', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis',cursor: 'pointer' }
        let workid = [];
        obj.showname = filterBR(obj.showname);
        workid.push(obj.id);
        // tdList[0].push(<div style={thStyleCopy}>{`${obj.showname}`}</div>)
        let tipTitle = Array.isArray(obj.title) && obj.title.filter(v => v !== '').length > 0;
        tdList[0].push(<Tooltip ecId={`${this && this.props && this.props.ecId || ''}_Tooltip@xi1pon@${obj.id}`} overlayStyle={{ wordBreak: 'break-all' }} placement='topLeft' arrowPointAtCenter title={tipTitle?obj.title.map((tip) => <div>{tip}</div>):''} placement="bottomRight" >
          <div onClick={() => { this.view(workid) }} style={thStyleCopy}>{`${obj.showname}`}</div>
        </Tooltip>)
      });
      thStyle = { ...thStyle, minHeight: HH }
      tdList[0].push(<div className="roomplan-td-modal" style={thStyle}></div>);
      return <td style={{backgroundColor: dayOfWeek[0] === moment().format('YYYY-MM-DD') ? '#ffc' : ''}}>{tdList[0]}</td>
    }
  }

  getTableHeaderInfo = (timeType, date) => {
    let { status } = this.props.workPlanViewListStore
    let { weekstartday } = toJS(status);
    let blockNum = 0, tableTitle = '', tableHeaders = [];
    let dateCopyMoment = moment(date);
    let weekday = new Array(7)
    weekday[0] = getLabel(16106,'周日')
    weekday[1] = getLabel(16100,'周一')
    weekday[2] = getLabel(16101,'周二')
    weekday[3] = getLabel(16102,'周三')
    weekday[4] = getLabel(16103,'周四')
    weekday[5] = getLabel(16104,'周五')
    weekday[6] = getLabel(16105,'周六')

    if (timeType == 'day') {
      blockNum = 1;
      let dayMoment=dateCopyMoment.day(dateCopyMoment.day());
      tableTitle = dayMoment.format(i18n.moment.dateformat.Md)+" ("+weekday[dayMoment.day()]+")";
      // tableTitle = dateCopyMoment.format(i18n.moment.dateformat.Md+" ("+weekday[dateCopyMoment.day()]+")");//"M月D日（ddd）"
      tableHeaders.push(tableTitle);
    } else if (timeType == 'week') {
      blockNum = 7;
      //tableTitle = dateCopyMoment.format("YYYY年ww周");
      for (var i = 0; i < blockNum; i++) {
        if (weekstartday == 0) {
          let dayMoment=dateCopyMoment.day(i);
          tableHeaders.push(dayMoment.format(i18n.moment.dateformat.Md)+" ("+weekday[dayMoment.day()]+")");
        } else if (weekstartday == 1 && dateCopyMoment.day() > 0) {
          let dayMoment=dateCopyMoment.day(i+1);
          tableHeaders.push(dayMoment.format(i18n.moment.dateformat.Md)+" ("+weekday[dayMoment.day()]+")");
        } else if (weekstartday == 1 && dateCopyMoment.day() == 0) {
          let dayMoment=dateCopyMoment.day(i-7+1);
          tableHeaders.push(dayMoment.format(i18n.moment.dateformat.Md)+" ("+weekday[dayMoment.day()]+")");
        }
      }
    } else {
      blockNum = dateCopyMoment.daysInMonth();
      //tableTitle = dateCopyMoment.format("YYYY年MM月") + `（${blockNum}天）`;
      let month = dateCopyMoment.month();
      let year = dateCopyMoment.year();
      let monthStr = (month+1) > 9 ? (month+1) : '0'+(month+1);
      let firstDay=moment(year+"-"+(monthStr)+"-01");
      let md=firstDay.format(i18n.moment.dateformat.Md);
      let day=firstDay.day();
      tableHeaders.push(`${md} (${weekday[day]})`);
      for (var i = 1; i < blockNum; i++) {
        firstDay=firstDay.add(1,'days');
        md=firstDay.format(i18n.moment.dateformat.Md);
        day=firstDay.day();
        tableHeaders.push(`${md} (${weekday[day]})`);
      }
    }
    return { blockNum: blockNum, tableTitle: tableTitle, tableHeaders: tableHeaders };
  }
 
   
  view = (e) => {
    this.props.workPlanViewListStore.open('preview', e[0], '')
  }

  Fontcolor=(hexColor)=> {
		let rgb = [1, 1, 1]; // read-only  0-1, 0-1, 0-1
	   
    if (hexColor.substr(0, 1) == "#")  hexColor = hexColor.substring(1);
    hexColor = hexColor.toLowerCase();
    let b = new Array();
    for (let x = 0; x < 3; x++) {
        b[0] = hexColor.substr(x * 2, 2)
        b[3] = "0123456789abcdef";
        b[1] = b[0].substr(0, 1)
        b[2] = b[0].substr(1, 1)
        b[20 + x] = b[3].indexOf(b[1]) * 16 + b[3].indexOf(b[2])
    }

    rgb[0]=b[20]/255;
    rgb[1]=b[21]/255;
    rgb[2]=b[22]/255;

    return 0.213 * rgb[0] +
         	  0.715 * rgb[1] +
				   	0.072 * rgb[2]
				 	< 0.5 ? '#FFFFFF' : '#000000';
     
  }
  // edit = (e) => {
  //   this.props.workPlanViewListStore.open('create', '', e)
  // }
   
  // drog = (params) => {
  //   const { status } = this.props.workPlanViewListStore
  //   let { selectedUser } = status;
  //   params = { ...params, isShare: '', selectedUser: selectedUser }
  //   myWorkPlanApi.editCalendarItemQuick(params).then((result) => {
  //   });
  // }
  // changeDateFormat = data => {
  //   if (typeof (data) === 'string' && data != '') {
  //     return data
  //   }
  //   //日期格式转为yyyy-MM-dd
  //   let now = data || new Date();
  //   let year = now.getFullYear();
  //   let month = (now.getMonth() + 1).toString();
  //   let day = (now.getDate()).toString();
  //   if (month.length == 1) {
  //     month = "0" + month;
  //   }
  //   if (day.length == 1) {
  //     day = "0" + day;
  //   }
  //   let dateString = year + "-" + month + "-" + day;
  //   return dateString;
  // }

}
// let createTitle = function (titleList) {
//   if (Array.isArray(titleList) && titleList.length > 0) {
//     return (
//       <div className="wea-roomplan-titletip">
//         {titleList.map((meet, idx) => {
//           return (
//             <div>
//               {meet.map((tip) => <div>{tip}</div>)}
//               {idx + 1 < titleList.length && <div className="line" />}
//             </div>
//           );
//         })}
//       </div>
//     );
//   }
//   return undefined;
// }

export default RightContainer
